home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / blit.zip / BLIT.DOC < prev    next >
Text File  |  1988-03-22  |  4KB  |  154 lines

  1. Blit, copyright 1988, Russell Nelson
  2.  
  3. Use it; pass it on; but don't make any money off of it.
  4.  
  5. Blit is a routine to copy a rectangle of bits from one location to
  6. another.  The only language binding is Turbo C, however, MS-C ought to
  7. work, since it's largely Turbo C compatible.  The algorithm was inspired
  8. by Rob Pike's implementation of blit documented in Software-Practice and
  9. Experience, Vol. 15(2), 131-151 (February 1985)].  If you want to know
  10. more about how blit operates then see Byte Magazine, August 1981, p.
  11. 168-194.  See the example code, bt.c, for a sample way to call blit.
  12.  
  13. -russ
  14.  
  15. Internet:   nelson@clutx.clarkson.edu
  16. BITNET:     NELSON@CLUTX
  17. Compuspend: 70441,205
  18. GEnie:      BH01
  19. Fido:       Russ Nelson@260/360
  20. Snail:      Clarkson University, Potsdam, NY 13676
  21. AT&T:       (315) 268-6591
  22.  
  23.  
  24. Interpreting the verbs:
  25.  
  26. The following charts show how the various verbs combine the src and dest
  27. bits.  Obviously, there are sixteen possibilities, only seven of which
  28. are implemented.  The rest are easy to do, I just never bothered.
  29.  
  30.  
  31. or1_verb (not implemented) - or the source with the not of the destination.
  32.  
  33.                  dest
  34.                | 0   1
  35.            -----------
  36.         src  0 | 1   0
  37.              1 | 1   1
  38.  
  39.  
  40. xnor_verb (not implemented) - exclusive nor the source and destination together.
  41.                  dest
  42.                | 0   1
  43.            -----------
  44.         src  0 | 1   0
  45.              1 | 0   1
  46.  
  47.  
  48. nor_verb (not implemented) - nor the source and the destination together.
  49.                  dest
  50.                | 0   1
  51.            -----------
  52.         src  0 | 1   1
  53.              1 | 1   0
  54.  
  55.  
  56. and1_verb (not implemented) - and the source with the not of the destination.
  57.                  dest
  58.                | 0   1
  59.            -----------
  60.         src  0 | 0   0
  61.              1 | 1   0
  62.  
  63.  
  64. nand_verb (not implemented) - nand the source and the destination together.
  65.                  dest
  66.                | 0   1
  67.            -----------
  68.         src  0 | 1   0
  69.              1 | 0   0
  70.  
  71.  
  72. zeroes_verb (not implemented) - zeroes the destination bitmap.
  73.                  dest
  74.                | 0   1
  75.            -----------
  76.         src  0 | 0   0
  77.              1 | 0   0
  78.  
  79.  
  80. ones_verb (not implemented) - sets the destination bitmap to ones.
  81.                  dest
  82.                | 0   1
  83.            -----------
  84.         src  0 | 1   1
  85.              1 | 1   1
  86.  
  87.  
  88. nop_verb (not implemented) - do nothing.
  89.                  dest
  90.                | 0   1
  91.            -----------
  92.         src  0 | 0   1
  93.              1 | 0   1
  94.  
  95.  
  96. invert_verb (not implemented) - invert the destination bitmap.
  97.                  dest
  98.                | 0   1
  99.            -----------
  100.         src  0 | 1   0
  101.              1 | 1   0
  102.  
  103.  
  104. pset_verb - copy the source to the destination.
  105.                  dest
  106.                | 0   1
  107.            -----------
  108.         src  0 | 0   0
  109.              1 | 1   1
  110.  
  111.  
  112. preset_verb - copy the inverse of the source to the destination.
  113.                  dest
  114.                | 0   1
  115.            -----------
  116.         src  0 | 1   1
  117.              1 | 0   0
  118.  
  119.  
  120. and_verb - and the source and destination together.
  121.                  dest
  122.                | 0   1
  123.            -----------
  124.         src  0 | 0   0
  125.              1 | 0   1
  126.  
  127.  
  128. and_not_verb - and the destination with the not of the source.
  129.                  dest
  130.                | 0   1
  131.            -----------
  132.         src  0 | 0   1
  133.              1 | 0   0
  134.  
  135.  
  136. or_verb - or the source and destination together.
  137.                  dest
  138.                | 0   1
  139.            -----------
  140.         src  0 | 0   1
  141.              1 | 1   1
  142. or_not_verb - or the destination with the not of the source.
  143.                  dest
  144.                | 0   1
  145.            -----------
  146.         src  0 | 1   1
  147.              1 | 0   1
  148. xor_verb - exclusive or the source and destination together.
  149.                  dest
  150.                | 0   1
  151.            -----------
  152.         src  0 | 0   1
  153.              1 | 1   0
  154.